<script>
    $(document).ready(function(){
        generic.validaForm("myFormModalCuest");
        
        $("#iframeContent1").load(function(){
            var myDiv = this.contentWindow.document.getElementsByTagName('div');
            if(myDiv.length>0){
            var idDiv = myDiv[0].getAttribute('id');
            
            var addClase = "";
            
            if(idDiv == 'asd'){
                addClase = "alert alert-danger";
            }else{
                  
                /*generic.init('modyActiv');
                setTimeout(function(){
                  $("#fade_out").fadeOut(0);
                  $("#fadeInAgregar").fadeIn(200);
                  $('#myModal').modal('hide')

                },1000)*/

                  
                addClase = "alert alert-success";
            }
            textError = $(myDiv[0]).html();
            (textError!='')?function(){
                $('#contentFrame1').html(textError).addClass(addClase).css("height", '48px');    
           }()
           :function(){
            $('#contentFrame1').removeClass(addClase).empty().css("height", '0px');;
           }();
        }
        
    });

         $("#btnClose").click(function(){
            $("#hid").val("1");
            generic.init('modyActiv');
         });
  });
</script>

<div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Captura de Cuestionario</h4>
      </div>
      <div class="modal-body" id='modalBody'>
        
<div id="contentFrame1"></div>
<iframe id="iframeContent1" name ="response1" style="display:none;"></iframe>
<div class="well" style="margin: 0px;">
    <form id="myFormModalCuest" name="myFormModalCuest" action="modules/newUser.php" method="POST" target="response1" class="bs-example form-horizontal">
        <fieldset>
            <div class="form-group">
                <label for="txtCuestionario" class="col-lg-2 control-label">Descripción</label>
                <div class="col-lg-10">
                    <textarea id="txtCuestionario" name="txtCuestionario" class="form-control" rows="3" ></textarea>
                </div>
            </div>
            <div class="form-group">
                <div class="col-lg-10 col-lg-offset-2" style="text-align: right;">
                    <button type="submit" name="btnGuardaCuestionario" class="btn btn-primary">Guardar</button>
                     <a  class="btn btn-default" id="btnClose" data-dismiss="modal">Cerrar</a>
                </div>
            </div>
        </fieldset>
    </form>
</div>

      </div>
      <div class="modal-footer">
                   <p class="pull-left">© 2013 webToolsDevelopers, Inc.</p>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->


